package exercise.day06;

import java.util.Arrays;

public class Method2 {
    public static void main(String[] args) {
        sy();
        syHi("大古");
        syHello("阿古茹",99);
        int a=10,b=90;
        int c=puls(a,b);
        System.out.println("sum："+c);
        int[] arr=testArray(10,60);
        System.out.println("长度"+arr.length);
        System.out.println("最后一个值："+arr[arr.length-1]);
        System.out.println("第一个值："+arr[0]);
        arr= Arrays.copyOf(arr,arr.length+1);
        int max=arr[0];
        for(int i=0;i<arr.length;i++){
            System.out.print(arr[i]+" ");
            if(max<arr[i]){
                max=arr[i];
            }
            arr[arr.length-1]=max;
        }
        System.out.println();
        System.out.println("最大值："+max);
    }
    public static void sy(){
        System.out.println("大家好，我叫盖亚");
    }
    public static void syHi(String name){
        System.out.println("大家好，我叫"+name+"今年暴瘦100斤");
    }
    public static void syHello(String name,int age){
        System.out.println("大家好，我叫"+name+",今年"+age+"岁了");
    }
    public static int  getNum(){
        return 88;
    }
    public static int puls(int a,int b){
        int sum=a*b;
        return sum;
    }
    public static int[] testArray(int len,int max){
        int[] arr=new int[len];
        for(int i=0;i<arr.length;i++){
            arr[i]=(int)(Math.random()*(100+1));
            System.out.println(arr[i]);
        }
        return arr;
    }
}
